<template>
  <div class="customer">
    <header-nav :currentIndex="2"></header-nav>
    <img
      class="cusimg"
      src="../../assets/imgs/微信图片_20210924175805.jpg"
      alt=""
    />
    <ul>
      <li v-for="(item, index) in list" :key="index">
        <img :src="item.image" alt="" />
        <div class="box">
          <div class="date-box">
            <p class="title">{{ item.title }}</p>
            <p>{{ item.create_date }}</p>
          </div>
          <p class="content" v-html="item.content"></p>
          <!-- <p>{{ item.project_desc }}</p> -->
        </div>
      </li>
    </ul>
    <div class="pagination">
      <el-pagination
        v-if="total_page != 1"
        background
        layout="prev, pager, next"
        :page-size="5"
        :total="total"
        @current-change="handlePage"
      ></el-pagination>
    </div>
    <footer-nav></footer-nav>
  </div>
</template>

<script>
import HeaderNav from "../../components/Header.vue";
import FooterNav from "../../components/Footer.vue";
export default {
  components: {
    HeaderNav,
    FooterNav,
  },
  data() {
    return {
      total: 0,
      total_page: 0,
      page: 1,
      list: [],
    };
  },
  mounted() {
    this.getList(1);
  },
  methods: {
    handlePage(page) {
      this.getList(page);
    },
    getList(page) {
      this.$axios
        .post("SaasCustomer/getCustomerList", {
          page,
        })
        .then((res) => {
          console.log(res);
          this.list = res.data.data.data;
          this.total = res.data.data.count;
          this.total_page = res.data.data.total_page;
        });
    },
  },
};
</script>

<style lang="less" scoped>
.customer {
  .cusimg {
    width: 100%;
    height: 600px;
  }
  ul {
    margin-top: 50px;
    li {
      display: flex;
      justify-content: center;
      margin-bottom: 50px;
      // height: 200px;
      img {
        width: 280px;
        height: 200px;
      }
      .box {
        width: 50%;
        padding: 20px 20px 10px;
        border: 1px solid #ececec;
        .date-box {
          display: flex;
          justify-content: space-between;
          margin-bottom: 20px;
          .title {
            font-size: 18px;
            color: #000;
          }
        }
        p {
          color: #808080;
          font-size: 14px;
          line-height: 30px;
          display: -webkit-box;
          -webkit-box-orient: vertical;
          text-overflow: ellipsis;
          -webkit-line-clamp: 3;
          overflow: hidden;
        }
      }
    }
  }
  .pagination {
    width: 22%;
    margin: 0 auto 50px;
  }
}
</style>